class Solution {
public:
    void judge(string &result)
    {
        int index=result.size()-2;

        if((result[index]+32)==result.back()||(result[index]-32)==result.back())
        {
            result.pop_back();
            result.pop_back();
        }

    }
    string makeGood(string s)
    {
        string result;
        int i;
        for( i=0;i<=s.size()-1;i++)//判断数据
        {
            if(i<s.size()&&(s[i]-32)==s[i+1]||(s[i]+32)==s[i+1])
            {
                i++;
            }
            else
            {
                result.push_back(s[i]);

                if(result.size()>1)
                    judge(result);//判断是否有重复

            }
        }
        return result;
    }
};
